package com.example.kyyl.http;

import android.os.Build;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class ConstantUrl {
    public static String BASEURL = "http://47.97.213.223:8080/services/";
    public static String CheckRegPhoneURL = "/user/checkUserIsExistsByPhone";
    public static String LoginURL = "/user/login";
    public static String RegSMS = "sms";
    public static String RegURL = "/user";
    public static String USERID = "user_id";
    public static String UpdateUserPwdURL = "/user/updatePassword";
    public static String UpdateUserURL = "/user/update";
    public static String addSubBatchURL = "/user/sub/batch";
    public static String addSubUserURL = "/user/sub";
    public static String cancelBandUserURL = "/user/sub/cancelBandUser";
    public static String reportMeasureBloodURL = "/measure";
    public static String setBandUserURL = "/user/sub/setBandUser";

    public static String dateToStr(Date date, String str) {
        if (date == null) {
            return null;
        }
        try {
            return new SimpleDateFormat(str, Locale.getDefault()).format(date);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static String getSystemModel() {
        return Build.MODEL;
    }
}
